Back to Contents        Previous        Next






7. Menus


FNwimp_createmenu(menu$,size%)
Creates a menu structure from the string menu$. Returns menu
handle.
For more information on menu$ see the manual.
If size%>number of items then the menu is dynamic, ie.
the number of menu items can be increased up to size%.
(If size%=0 the menu will automatically be created to accomodate just the number of items contained in menu$.)
(All menu text is created as indirected.)

FNwimp_createmenuarray(array$(),size%)
Creates a menu from the array supplied. Returns menu handle.
Each item of the menu is in a separate element of the array.
e.g. array$(1)=‘Info’.
The first element, array$(0), is the menu title, and the last
must be the string “END”.
array$() = array holding item strings.
size% = maximum number of elements to allocate room for
(doesn’t have to be the current number). (If size%=0 the menu will automatically be created to accomodate just the number of items contained in the array.)
Returns a handle to the menu.
(All menu text is created as indirected.)

FNwimp_createmessagemenu(messagefilehandle%,token$,title$,size%)
Creates a menu automatically from a Message file. Returns menu handle.
messagefilehandle%= handle of messages file to be used (as returned by
FNwimp_initmessages/FNwimp_reinitmessages).
token$ = token for menu. Eg: if token$=“MMenu” then the token “MMenuT” will specify the title, “MMenu1” the first item, “MMenu2” the second etc.
If title$=“” then the title defined in the message file will be used, otherwise title$ will override whatever is defined in the messages file.
If size%>number of items then the menu is dynamic, ie. the items can subsequently be increased up to size%. (If size%=0 the menu will automatically be created to accomodate just the number of items contained in the messages file.)
(All menu text is created as indirected.)
(Also shown in Messages section.)

PROCwimp_recreatemenu(menu%,menu$)
Rebuilds a menu using the string menu$.
More items can be included than the first time as long as you don’t go
over the pre-defined limit.
menu% = handle of menu to rebuild.


PROCwimp_recreatemenuarray
(menu%,array$())
Rebuilds a menu using the items in the array.
The first array item (array$(0)) is the menu title, and the
last has to be the string “END”.
Things like ticks and dotted lines are removed.
menu% = handle of menu to rebuild
array$() = array to get items from.

PROCwimp_recreatemessagemenu(menu%,messagefilehandle%,token$-,title$)
Rebuilds a menu from a Message file.
menu% = handle of menu to rebuild
messagefilehandle%= handle of messages file to be used (as returned by
FNwimp_initmessages/FNwimp_reinitmessages).
token$ = token for menu items. (See FNwimp_createmessagemenu() or Manual Section 2.18)
If title$=“” then the title defined in the message file will be used, otherwise title$ will override whatever is defined in the messages file.
(All menu text is created as indirected.)
(Also shown in Messages section.)


FNwimp_createfontmenu
Creates a complete menu structure of the currently available (active) fonts.
A menu handle is returned.
(The many wimp-functions available to manipulate individual menu items cannot be applied to font menus.)

FNwimp_recreatefontmenu(fontmenu%)
Re-creates a complete menu structure of the currently available (active) fonts, for a previously created font menu.
fontmenu% = handle of previously created font menu.
The menu handle is returned (which may be a new value).
(The many wimp-functions available to manipulate individual menu items cannot be applied to font menus.)



PROCwimp_attachsubmenu(menu%,item%,submenu%)
Attaches a submenu to a menu item.
menu% = handle of menu.
item% = item number (top item is 1).
submenu% = handle of submenu or window handle.



PROCwimp_menupopup(menu%,pos%,x%,y%)
Displays the menu (or window) whose handle is menu%.
If pos%=0 then menu is displayed with its top left corner at screen coordinates x%,y%.
If pos%=1 then menu will be positioned as for an iconbar menu, as if
iconbar icon is at screen coordinate x% i.e. with left edge to the left of x% and at 96 OS units above the bottom of screen. (y% value is needed but is ignored.)
If pos%=2 then menu will be centred on screen (x%/y% values ignored but must be present)
If pos%=3 then menu will be opened slightly to the right of (and slightly above) pointer position - optimised to butt onto right edge of ‘ptr_menu’ shape.
If pos%=4 then menu will be opened butting up against the right edge of the icon over which the mouse was clicked. (Designed to be used with ‘pop-up menu icons’.)
Can also be used to open windows that close when the mouse is clicked elsewhere.


PROCwimp_menuclose
Closes the currently active menu.
Used if menu closure is required other than by normal (automatic) wimp process.


PROCwimp_menuenable(menu%,item%,state%)
Allows a menu item to be enabled/disabled(’greyed out’) or to be toggled between these two states.
menu% = handle of menu.
item% = item number (top item is 1).
If state% =0, the menu item will be disabled (’greyed out’) and will not respond to mouse clicks.
If state% =1, the menu item will be enabled.
If state% =2, the menu item will be toggled from its existing state to the other.


FNwimp_getmenuenable(menu%,item%)
Checks whether a menu item is enabled or disabled (’greyed out’).
menu% = handle of menu.
item% = item number (top item is 1).
Returns 1 if menu item is enabled.
Returns 0 if menu item is disabled (’greyed out’).



PROCwimp_putmenuitem(menu%,item%,item$)
Adds a new menu item at position item%. Any items below will be shuffled down. (menu% must have been already created with sufficient capacity to add extra items - see manual Section 2.18)
menu% = handle of menu.
item% = position of new item% (1 is first item) If item% is bigger than the current number of items+1, then it will be added to the bottom.
item$ = text of new item.

PROCwimp_removemenuitem(menu%,item%)
Removes the item from the menu. Any items below are
shuffled up. If there is only one item on the menu, then
it cannot be removed.
menu% = handle of menu.
item% = number of item to remove.


PROCwimp_putmenutext(menu%,item%,text$)
Replaces menu item text with text$.
menu% = handle of menu.
item% = number of item (Top item is 1).


FNwimp_getmenutext(menu%,item%)
Returns a string containing the text of the menu item in position item%.
menu% = handle of menu.
item% = number of item (top item is 1).

PROCwimp_putmenutitle(menu%,title$)
Changes the title of the menu.
More than 11 characters can be used.
menu% = handle of menu.
title$ = new title.

FNwimp_getmenutitle(menu%)
Returns a string containing the title of the menu.
menu% = handle of menu.


FNwimp_getmenuitem(menu%,menuitemtext$)
Returns the menu item number (top=1) of the menu item whose text matches menuitemtext$.
menu% = handle of menu to search
menuitemtext$ = text string to match (not case sensitive)
Returns 0 if no match found.

PROCwimp_menutick(menu%,item%,state%)
This function puts/removes a tick against the specified menu item - or toggles between these two states.
menu% = handle of menu.
item% = item number (top item is 1).
If state% = 0, any tick against the item will be removed.
If state% =1, a tick will be put against the item.
If state%=2, the tick will be toggled from its existing state to the other.

FNwimp_getmenutick(menu%,item%)
Returns 1 if the specified menu item is ticked, or returns 0 if it isn’t.
menu% = handle of menu.
item% = number of item (top item is 1).

FNwimp_menusize(menu%)
Returns the current number of entries (items) in the menu.
menu% = handle of menu.


FNwimp_menumaxsize(menu%)
Returns the maximum number of entries (items) allowed in the menu, as determined on creation.
menu% = handle of menu.


PROCwimp_menudottedline(menu%,item%,on%)
Adds/removes a dotted line to the menu below the item.
menu% = handle of menu.
item% = number of item (top item is 1).
If on%=1 dotted line is added; if on%=0 dotted line is removed.

FNwimp_getmenudottedline(menu%,item%)
Checks whether or not a menu item has a dotted line beneath it.
menu% = handle of menu.
item% = number of item (top item is 1).
Returns a 1 if the menu item has a dooted line beneath it.
Returns a 0 if the menu item does not have a dooted line beneath it.


PROCwimp_menuitemcolour(menu%,item%,colour%,background%)
Changes the text colour of the menu item specified.
menu% = handle of menu.
item% = item number (top item is 1).
colour% = colour required (standard Wimp colours in range 0-15)
(Colours 8, 10, 11, 13, 14 and 15 are best for visibility)
If background% = 1 then the background colour is changed.
If background% = 0 then the foreground colour is changed

PROCwimp_menuwrite(menu%,item%,maxlength%,border%,valid$)
Makes the menu item writable.
menu% = handle of menu.
item% = number of item (top item is 1)
maxlength% = maximum length of text allowed to be entered.
If border%=1 a border will be placed around writable item.
If border%=0 no border will appear.
valid$ = validation string. (A default validation string “Pptr_write;Knar;” will always be applied - to which valid$ will be suffixed. See Section 2.5)
(Any text already in the item will be re-inserted into the new writable item. If the existing text is longer than maxlength% then maxlength% will be increased accordingly.)



PROCwimp_group(handle%,type%,string$,state%)
NOT IN DrWimp LIBRARY.
ONLY USED AS PART OF ‘
Elixir_07’ - see Manual Section 2.36 and 3.16.

FNwimp_findmenuticksstring(menu%)
NOT IN DrWimp LIBRARY.
ONLY USED AS PART OF ‘
Elixir_07’ - see Manual Section 2.36 and 3.16.


FNwimp_findmenuticksnumber(menu%)
NOT IN DrWimp LIBRARY.
ONLY USED AS PART OF ‘
Elixir_07’ - see Manual Section 2.36 and 3.16.






Top of page        Back to Contents        Previous        Next